﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace National.Bll.IService
{
   public interface IBaseService<T>
    {
        bool Add(T entity, int role, int module);
        bool AddRange(List<T> entity);
        bool Delete(T entity);
        bool BatchDelete(List<T> entitys);
        bool BatchDelete(params int[] ids);
        bool Delete(int id);
        bool Update(T entity);
        List<T> QueryList(Expression<Func<T, bool>> lambdaExpression);
        T Query(Expression<Func<T, bool>> lambdaExpression);
        bool Exists(Expression<Func<T, bool>> lambdaExpression);
        List<T> QueryPageList<S>(int PageSize, int PageIndex, Expression<Func<T, bool>> whereLambda, Expression<Func<T, S>> orderbyLambda, out int count, bool isAsc = true);
    }
}
